$(function () {
    //获取屏幕宽度
    var w = $(window).width();
    var MobileUA = (function() {
        var ua = navigator.userAgent.toLowerCase();

        var mua = {
            IOS: /ipod|iphone|ipad/.test(ua), //iOS
            IPHONE: /iphone/.test(ua), //iPhone
            IPAD: /ipad/.test(ua), //iPad
            ANDROID: /android/.test(ua), //Android Device
            WINDOWS: /windows/.test(ua), //Windows Device
            TOUCH_DEVICE: ('ontouchstart' in window) || /touch/.test(ua), //Touch Device
            MOBILE: /mobile/.test(ua), //Mobile Device (iPad)
            ANDROID_TABLET: false, //Android Tablet
            WINDOWS_TABLET: false, //Windows Tablet
            TABLET: false, //Tablet (iPad, Android, Windows)
            SMART_PHONE: false //Smart Phone (iPhone, Android)
        };

        mua.ANDROID_TABLET = mua.ANDROID && !mua.MOBILE;
        mua.WINDOWS_TABLET = mua.WINDOWS && /tablet/.test(ua);
        mua.TABLET = mua.IPAD || mua.ANDROID_TABLET || mua.WINDOWS_TABLET;
        mua.SMART_PHONE = mua.MOBILE && !mua.TABLET;

        return mua;
    }());

    //SmartPhone
    if (MobileUA.SMART_PHONE) {
        // 移动端链接地址
        $("#home, #slitSlider, .sl-slider, .sl-content-wrapper, .ph-1200").css("width","1200px")
    }else{
        $("#home, #slitSlider, .sl-slider, .sl-content-wrapper, .ph-1200").css("width","100%")
    }


    //头部导航切换
    $("ul.nav").on("click","li",function(){
        $(this).addClass("act").siblings().removeClass("act");
    });
    //底部导航
    $("ul.footNav").on("click","li",function(){
        $(this).addClass("on").siblings().removeClass("on");
    });

    //头部固定
    var navOffset=$(".navBox").offset().top;
    $(window).scroll(function(){
        var scrollPos=$(window).scrollTop();
        if(scrollPos >navOffset){
            $(".navBox").addClass("fixed");
        }else{
            $(".navBox").removeClass("fixed");
        }
    });
});
jQuery(function ($) { "use strict";
    var nice = $("html").niceScroll({
        cursorborderradius: 0,
        cursorwidth: "8px",
        cursorfixedheight: 150,
        cursorcolor: "#6CB670",
        zindex: 9999,
        cursorborder: 0,
    });

    (function() {
        var count = {
            initialized : false,
            initialize : function() {
                if (this.initialized)
                    return;
                this.initialized = true;
                this.build();
            },
            build : function() {
                this.animations();
            },
            animations : function() {
                // Count To
                $(".counters-item [data-to]").each(function() {
                    var $this = $(this);
                    $this.appear(function() {
                        $this.countTo({});
                    }, {
                        accX : 0,
                        accY : -150
                    });
                });
            },
        };
        count.initialize();
    })();

});

wow = new WOW({
    animateClass: 'animated',
    offset: 120
});
wow.init();
